using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FiltronASP.Helpers.Pagination;
using FiltronASP.Models;

namespace FiltronASP.Areas.Admin.ViewModels.Pages
{
    /// <summary>
    /// ViewModel dla akcji <code>Index</code> stron.
    /// </summary>
    public class PagesIndexViewModel : BaseViewModel
    {
        /// <summary>
        /// spaginowana lista stron
        /// </summary>
        public PagedList<Page> PaginatedPages { get; set; }

        /// <summary>
        /// id szablonu z drop downa
        /// </summary>
        public int DropDownTemplateId { get; set; }

        /// <summary>
        /// lista jezykow do drop downa
        /// </summary>
        public IEnumerable<SelectListItem> TemplatesToDropDown { get; set; }

        /// <summary>
        /// aktualna grupa stron
        /// </summary>
        public PageType CurrentPageType { get; set; }

        /// <summary>
        /// Biezaca strona paginacji.
        /// </summary>
        public int PaginationPage { get; set; }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        public PagesIndexViewModel()
            : base()
        {
        }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="languagesToDropDown">lista jezykow do drop downa</param>
        /// <param name="pageTypesInMenu">lista grup stron do menu z lewej</param>
        /// <param name="paginatedPages">spaginowana lista stron</param>
        /// <param name="currentPageType">aktualna grupa stron</param>
        /// <param name="templatesToDropDown">lista szablonow do drop downa</param>
        /// <param name="paginationPage">biezaca strona paginacji</param>
        public PagesIndexViewModel(IQueryable<Language> languagesToDropDown,
            IQueryable<PageType> pageTypesInMenu, IQueryable<Menu> menusInMenu, 
            Language currentLanguage, 
            PagedList<Page> paginatedPages,
            IEnumerable<SelectListItem> templatesToDropDown,
            PageType currentPageType,
            int paginationPage) 
            : base(languagesToDropDown, pageTypesInMenu, menusInMenu, currentLanguage)           
        {
            this.PaginatedPages = paginatedPages;
            this.TemplatesToDropDown = templatesToDropDown;
            this.CurrentPageType = currentPageType;
            this.PaginationPage = paginationPage;
        }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="languagesToDropDown">lista jezykow do drop downa</param>
        /// <param name="pageTypesInMenu">lista grup stron do menu z lewej</param>
        /// <param name="paginatedPages">spaginowana lista stron</param>
        /// <param name="currentPageType">aktualna grupa stron</param>
        /// <param name="templatesToDropDown">lista szablonow do drop downa</param>
        public PagesIndexViewModel(IQueryable<Language> languagesToDropDown,
            IQueryable<PageType> pageTypesInMenu, IQueryable<Menu> menusInMenu,
            Language currentLanguage,
            PagedList<Page> paginatedPages,
            IEnumerable<SelectListItem> templatesToDropDown,
            PageType currentPageType)
            : base(languagesToDropDown, pageTypesInMenu, menusInMenu, currentLanguage)
        {
            this.PaginatedPages = paginatedPages;
            this.TemplatesToDropDown = templatesToDropDown;
            this.CurrentPageType = currentPageType;
            this.PaginationPage = 1;
        }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="languagesToDropDown">lista jezykow do drop downa</param>
        /// <param name="pageTypesInMenu">lista grup stron do menu z lewej</param>
        /// <param name="menusInMenu">lista menu do menu z lewej</param>
        /// <param name="currentLanguage">aktualna wersja jezykowa</param>
        public PagesIndexViewModel(IQueryable<Language> languagesToDropDown,
            IQueryable<PageType> pageTypesInMenu, IQueryable<Menu> menusInMenu, Language currentLanguage)
            : base(languagesToDropDown, pageTypesInMenu, menusInMenu, currentLanguage)
        {
            this.PaginationPage = 1;
        }

    }
}
